<div id="hp_intro"><%= @page_title %></div>
<p>
<% if not @priorities or @priorities.empty? %>
	<%= t('briefing.documents.needed.empty')%>
<% else %>
	<%= blurb("docs_needed_intro")%>
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td align="right" style="padding-right: 5px;"><span class="table_header"><%= t('rank') %></span></td>
			<td style="padding-left: 3px;"><span class="table_header"><%= t('time.wk') %></span></td>
			<td style="padding-left: 3px;"><span class="table_header"><%= t('time.mo') %></span></td>
			<td style="padding-left: 7px; padding-bottom: 2px;"><%= will_paginate @priorities %></td>	
		</tr>
	<% for priority in @priorities %>
		<% if @endorsements %>
			<% endorsement = @endorsements.detect {|e| e.priority_id == priority.id } %>
		<% end %>
		<tr>
			<%= render :partial => "priorities/rank_week_month", :locals => {:priority => priority } %>
			<td valign="top" style="padding-left: 8px;">
			<div id="priority_<%= priority.id %>" class="priority_listing">
				<div class="priority_name" id="priority_<%= priority.id %>_name">
					<%= link_to_unless_current h(priority.name), new_priority_document_path(priority), :class => "priority_name_link" %>
				</div>
				<%= render :partial => "priorities/tag_show", :locals => { :priority => priority }%>
				<div class="priority_actions">
					<%= render :partial => "priorities/button_small", :locals => {:priority => priority, :endorsement => endorsement, :region => "priority_inline"} %>
					<%= render :partial => "priorities/endorsement_count", :locals => {:priority => priority }%>
				</div>			

			</div>
			</td>
		</tr>
	<% end %>

	</table>
	<p>
	<%= will_paginate @priorities %>
<% end %>

